<!-- 表单修改 -->

<template>
  <WebForm>
    <EasyRow col3>
      <FormInput label="节点名称" bind="name" :max="8" required />
      <FormTree label="上级节点" bind="parentId" :dict="treeDict" disabled />
      <FormNum label="排序" bind="sort" :min="1" :max="999" tip="请输入" initMin required />
    </EasyRow>

    <EasyRow col3>
      <FormSelect label="跳转逻辑" bind="jumpLogic" :dict="DICT.JUMP" noClear required @change="changeJump" />

      <FormInput v-if="one.jumpLogic === 1" v-bind="forwordProps" />
      <FormInput v-if="one.jumpLogic === 1" v-bind="linkProps" />

      <FormLink v-if="one.jumpLogic === 2" v-bind="linkProps" third2 />
    </EasyRow>

    <FormTextarea label="备注" bind="remark" :max="100" :rows="[2]" />

    <EditButton :noDel="!CORE.isEmpty(one.children)" />
  </WebForm>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import FormAdd from '@admin/views/System/Menu/MenuDashboard/FormAdd'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'FormEdit',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb(), CORE.mixTree()],

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(
    require.context('@admin/views/System/Dict/DictData/FormEdit', true, /vue$/),
    require.context('./', true, /vue$/),
  ),

  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: FormAdd.computed,

  /**
   * 本地方法 (轻量重要在前)
   */
  methods: FormAdd.methods,
}
</script>
